A Type-Sensitive Preprocessor For Haskell
نویسنده
چکیده
This paper presents a preprocessor which generates code from type de nitions. The preprocessor uses rules to describe the pattern of the produced code. In this way, instances may be derived for type classes. Utility functions for manipulating types, especially records, can also be produced. The set of rules is easily extendible; by adding derivation rules for new type classes, instance derivation is possible for classes de ned outside the prelude.
منابع مشابه
Re ections on Instance
This paper examines the use of type-safe linguistic reeection in Haskell, a functional language. Several uses are identiied: providing an extensible system of instance derivation; extending derivation beyond type classes and providing a method for polytypic programming. A preprocessor for Haskell is presented that performs compile-time reeection upon type declarations in source code.
متن کاملA Rendezvous of Functions and Reactive Objects | Escaping the Evil I
We present an extension to Haskell which supports reactive, concurrent programming with objects, sans the problematic blocking input. We give a semantics together with a number of programming examples, and show an implementation based on a preprocessor, and a library written in Concurrent Haskell.
متن کاملSession Types in Haskell Updating Message Passing for the 21st Century
Session Types allow plans of conversation between two concurrent processes to be treated as types. Type checking then ensures that communication between processes is safe: i.e. it obeys the protocol specified by the session type. Thus Session Types offer a means to establish conformance to protocols in both distributed applications and multi-threaded programming. We incorporate Session Types in...
متن کاملFunctional Pearl: Replaying the stack for parsing and pretty printing
Modulo inessential details, parsers and pretty printers, to and from algebraic datatypes, offer an uncanny resemblance and yet are all too often defined separately, in gross violation of the “don’t repeat yourself” principle. We present a family of reversible parser/printer combinators that allows one to define both at once in a type-safe manner, compositionally and without any need for a prepr...
متن کاملReactive Objects in a Functional Language an Escape from the Evil \i"
We present an extension to Haskell which supports reactive, concurrent programming with objects, sans the problematic blocking input. We give a semantics together with a number of programming examples, and show an implementation based on a preprocessor and a library implementing seven monadic constants.
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1997